package com.ngc.mall.controller;

import com.ngc.mall.common.configure.response.ResponseResult;
import com.ngc.mall.domain.ArticleDomain;
import com.ngc.mall.service.IArticleService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * 文章
 * @author: chenxiaolin
 * @date 2023/10/11 16:55
**/
@RestController
@RequestMapping("/article")
public class ArticleController {

    @Autowired
    private IArticleService iArticleService;

    @GetMapping("/id/{id}")
    @ApiOperation("根据id获取文章")
    public ResponseResult<ArticleDomain> getById(@PathVariable Long id){
        return ResponseResult.success(iArticleService.getDetailById(id));
    }
}
